/*
 * @Description:加载动画组件
 */
import React from 'react';
import PropTypes from 'prop-types';
import { Spin } from 'antd';
import { LoadingOutlined } from '@ant-design/icons';

import memo from './wrapMemo';

import style from './Loading.module.scss';

const Loading = memo((props) => {
    const { style: propsStyle, text='加载中...' } = props;
    return (
        <div className={style.loading} style={propsStyle}>
            <Spin size="large" indicator={<LoadingOutlined style={{ fontSize: 30 }} spin />} />
            {text && <span>{text}</span>}
        </div>
    );
});

Loading.displayName = 'Loading';
Loading.propTypes = {
    style: PropTypes.object,
    text: PropTypes.string,
};
export default Loading;
